using System;
using NEnsure.Validators;

namespace NEnsure
{
	public delegate void ValidationHandler<T>(object sender, T e);

	public interface IValidator
	{
		IRuleContainer[] RuleContainers { get; }

		BrokenRuleList BrokenRules { get; }

		event ValidationHandler<ValidationEventArgs> ValidationStart;

		event ValidationHandler<EventArgs> ValidationEnd;

		event ValidationHandler<PropertyRulesEventArgs> ValidatingProperty;

		event ValidationHandler<PropertyRulesEventArgs> ValidatedProperty;

		IRuleContainer<T> Ensure<T>(string propertyName, T propertyValue);

		IValidator Reset();

		void EnsureAll();
	}
}
